package ioc14;

import org.springframework.beans.factory.FactoryBean;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

public class SaxParserFactoryBean implements FactoryBean {
    @Override
    public Object getObject() throws Exception {
        SAXParserFactory spf = SAXParserFactory.newInstance();
        SAXParser saxParser = spf.newSAXParser();
        return saxParser;
    }

    @Override
    public Class<?> getObjectType() {
        return SAXParser.class;
    }

    @Override
    public boolean isSingleton() {
        return true;
    }
}
